package com.edu.chongdian;

import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import android.content.Intent;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.view.View;

import com.edu.chongdian.viewmodels.pageadapter;

import java.util.ArrayList;
import java.util.List;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;

public class MainActivity extends AppCompatActivity {
    private ViewPager viewPager;
    private List<Integer> list=new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        viewPager = findViewById(R.id.page);

        list.add(R.mipmap.banner_n);
        list.add(R.mipmap.sign_card);
        pageadapter adapter = new pageadapter(this);
        adapter.setList(list);
        viewPager.setAdapter(adapter);
        viewPager.setCurrentItem(1 * 500, false);
    }

    void initView(){
        LinearLayout linearLayout=findViewById(R.id.fu_jin_wang_dian);

        linearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this, MapActivity.class);

                startActivity(intent);
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d("ADDRESS","onDestroy");
    }

    public void xinyonghu(View view) {
        Intent intent=new Intent(MainActivity.this, xinyonghufuliActivity.class);
        startActivity(intent);
    }

    public void personcenter(View view) {
        Intent intent=new Intent(MainActivity.this,PersoncenterActivity.class);
        startActivity(intent);
    }

    public void chongdian(View view) {
        Intent intent=new Intent(MainActivity.this,SaomaMainActivity.class);
        startActivity(intent);
    }
}